package com.gpf.marketing.controller;


import com.gpf.marketing.pojo.entity.CustIssues;
import com.gpf.marketing.pojo.vo.CusIssVo;
import com.gpf.marketing.service.CustIssuesService;
import com.seventh.common.pojo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: clms-fifth
 * @description: 客服问答的控制层
 * @author: 龚鹏飞
 * @create: 2021-07-21 19:08
 **/
@RestController
@RequestMapping("marketing/issues")
public class CustIssuesController {
    @Autowired
    private CustIssuesService custIssuesService;

    @PostMapping("selectCustIssues/{currentPage}/{pageSize}")
    public R selectCustIssues(@PathVariable("currentPage") Integer currentPage,
                              @PathVariable("pageSize") Integer pageSize,
                              @RequestBody CusIssVo cusIssVo){
        return custIssuesService.selectCustIssues(currentPage,pageSize,cusIssVo);
    }

    @PostMapping("insertCustIssues")
    public R insertCustIssues(@RequestBody CustIssues custIssues){
        return custIssuesService.insertCustIssues(custIssues);
    }

    @PutMapping("updateCustIssues")
    public R updateCustIssus(@RequestBody CustIssues custIssues){
        return custIssuesService.updateCustIssues(custIssues);
    }

    @DeleteMapping("deleteCustIssues/{id}")
    public R deleteCustIssues(@PathVariable Integer id){
        return custIssuesService.deleteById(id);
    }
    @GetMapping("byId/{id}")
    public R byId(@PathVariable Integer id){
        return custIssuesService.selectById(id);
    }
}
